package com.example.practice;

import java.io.IOException;

import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.http.GET;

public class NetWroks {
    private interface Blog{
        @GET("carlist")
        Call<ResponseBody> getBlog();
    }
    private String http(){
        Retrofit retrofit = new Retrofit.Builder()
                .baseUrl("http/hh1.me:5001/")
                .build();
        Blog blog = retrofit.create(Blog.class);
        Call<ResponseBody> call = blog.getBlog();
        call.enqueue(new Callback<ResponseBody>() {
            @Override
            public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
                try {
                    response.body().string();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }

            @Override
            public void onFailure(Call<ResponseBody> call, Throwable t) {

            }
        });
        return null;
    }
}
